﻿<UserControl xmlns:Controls="clr-namespace:WinRTXamlToolkit.Controls" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" 
    x:Class="NexusCamera.CameraControl"
    mc:Ignorable="d"
    d:DesignHeight="480" d:DesignWidth="480">
	<UserControl.Resources>
		<Style x:Key="CircleOfLive" TargetType="Button">
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="Button">
						<Grid>
							<VisualStateManager.VisualStateGroups>
								<VisualStateGroup x:Name="CommonStates">
									<VisualState x:Name="Normal"/>
									<VisualState x:Name="Disabled"/>
									<VisualState x:Name="MouseOver"/>
                                </VisualStateGroup>
								<VisualStateGroup x:Name="FocusStates">
									<VisualState x:Name="Focused"/>
								</VisualStateGroup>
							</VisualStateManager.VisualStateGroups>
							<Ellipse x:Name="ellipse" RenderTransformOrigin="0.5,0.5" Stroke="DeepSkyBlue" StrokeThickness="2" Fill="Transparent">
								<Ellipse.RenderTransform>
									<CompositeTransform/>
								</Ellipse.RenderTransform>
							</Ellipse>
							<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<Storyboard x:Name="circleAnimation">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)" Storyboard.TargetName="Menu">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.8">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)" Storyboard.TargetName="Menu">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.8">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)" Storyboard.TargetName="Menu">
				<EasingDoubleKeyFrame KeyTime="0" Value="-10"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-8.5">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)" Storyboard.TargetName="Menu">
				<EasingDoubleKeyFrame KeyTime="0" Value="10"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="11.5">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="Menu">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-1.219">
					<EasingDoubleKeyFrame.EasingFunction>
						<CircleEase EasingMode="EaseIn"/>
					</EasingDoubleKeyFrame.EasingFunction>
				</EasingDoubleKeyFrame>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</UserControl.Resources>
    
	<UserControl.FontFamily>
		<StaticResource ResourceKey="PhoneFontFamilyNormal"/>
	</UserControl.FontFamily>
	<UserControl.FontSize>
		<StaticResource ResourceKey="PhoneFontSizeNormal"/>
	</UserControl.FontSize>
	<UserControl.Foreground>
		<StaticResource ResourceKey="PhoneForegroundBrush"/>
	</UserControl.Foreground>

    <Grid x:Name="LayoutRoot" Background="Transparent" Width="Auto" Height="Auto">
        <Button x:Name="Menu" MouseEnter="Menu_MouseEnter" HorizontalAlignment="Left" Height="100" Margin="100,100,0,0" Style="{StaticResource CircleOfLive}" VerticalAlignment="Top" Width="100" RenderTransformOrigin="0.5,0.5" Background="Black">
    		<Button.BorderBrush>
    			<ImageBrush Stretch="Fill"/>
    		</Button.BorderBrush>
    		<Button.RenderTransform>
    			<CompositeTransform/>
    		</Button.RenderTransform>
    	</Button>
    </Grid>
</UserControl>